<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('pid');                    // 菜单的父ID
            $table->string('name', 50);                // 菜单的名称
            $table->string('url');                     // 菜单的地址
            $table->string('method');                  // 访问的控制器和方法
            $table->string('label');                   // 标签描述
            $table->integer('order');                  // 排序
            $table->boolean('status')->default(1);     // 状态
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('menus');
    }
}
